/********************************************************************************
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
 *                                                                              *
 *              This software is distributed under the terms of the             *
 *              GNU Lesser General Public Licence (LGPL) version 3,             *
 *                  copied verbatim in the file "LICENSE"                       *
 ********************************************************************************/
#ifndef HIMUSICCALIBRATEDDATA_H
#define HIMUSICCALIBRATEDDATA_H

#include "HiMusicWaveEvent.h"
#include "TObject.h"
#include "TClonesArray.h"

class HiMusicCalibratedData : public TObject
{
private:
    uint64_t fEventID;
    uint8_t fDetID;
    uint8_t fNWaves0;
    uint8_t fNWaves1;
    uint8_t fNWaves2;
    uint8_t fNWaves3;
    uint8_t fNWaves4;
    uint8_t fNWaves5;
    uint8_t fNWaves6;
    uint8_t fNWaves7;
    uint8_t fNWaves8;
    TClonesArray *fChanData0; ////store array of WaveData data for channel0
    TClonesArray *fChanData1; ////store array of WaveData data for channel1
    TClonesArray *fChanData2; ////store array of WaveData data for channel2
    TClonesArray *fChanData3; ////store array of WaveData data for channel3
    TClonesArray *fChanData4; ////store array of WaveData data for channel4
    TClonesArray *fChanData5; ////store array of WaveData data for channel5
    TClonesArray *fChanData6; /// store array of WaveData data for channel6
    TClonesArray *fChanData7; ////store array of WaveData data for channel7
    TClonesArray *fChanData8; ////store array of WaveData data for channel8
    uint64_t fTimeStamp;
    uint64_t fTimeStamp_pre;

public:
    HiMusicCalibratedData();
    HiMusicCalibratedData(const HiMusicCalibratedData &data);
    ~HiMusicCalibratedData();

    void Reset();
    uint64_t GetEventID() { return fEventID; }
    uint8_t GetNumOfWaves(uint8_t chId);

    TClonesArray *GetChannels(uint8_t chId) const;
    uint64_t GetTimeStamp() { return fTimeStamp; }
    uint64_t GetTimeStamp_pre() { return fTimeStamp_pre; }
    uint8_t GetDetID() { return fDetID; }

    void SetEventID(uint64_t id) { fEventID = id; }
    void SetTimeStamp(uint64_t ts) { fTimeStamp = ts; }
    void SetTimeStamp_pre(uint64_t ts) { fTimeStamp_pre = ts; }
    void SetDetID(uint8_t id) { fDetID = id; }
    void SetChannel(uint8_t chId, const TClonesArray *src);

    void AddChannel(uint8_t chId, HiMusicWaveEvent &ch);

    ClassDef(HiMusicCalibratedData, 1);
};

#endif // !HIMUSICCALIBRATEDDATA_H